﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Runda.CMS.Common.Entity;
using System.Collections.Generic;
using Runda.CMS.Bll;

namespace Runda.CMS.Portal.Lookup
{
    public partial class SelectInstrument : BasePage
    {
        public override bool IsCheckAccessible
        {
            get
            {
                return false;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            List<WsmInstrumentInfoEntity> list = new CtrtBilldetailBll().GetAll<WsmInstrumentInfoEntity>("");

            RepeaterContract.DataSource = list;
            RepeaterContract.DataBind();
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string WhereClause = " and InstrumentName like '%{0}%'";
            if (txtName.Text != "")
            {
                WhereClause = string.Format(WhereClause, txtName.Text);
            }
            else
                WhereClause = "";

            List<WsmInstrumentInfoEntity> list = new CtrtBilldetailBll().GetAll<WsmInstrumentInfoEntity>(WhereClause);

            RepeaterContract.DataSource = list;
            RepeaterContract.DataBind();
        }
    }
}
